package shop.services.front.organize.dao.impl;

import org.springframework.stereotype.Repository;
import shop.core.common.dao.BaseDao;
import shop.core.common.dao.page.PagerModel;
import shop.services.front.organize.bean.Organize;
import shop.services.front.organize.dao.OrganizeDao;


import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2017/4/20.
 */
@Repository("organizeDaoFront")
public class OrganizeDaoImpl implements OrganizeDao {
    @Resource
    private BaseDao dao;
    public void setDao(BaseDao dao) {
        this.dao = dao;
    }

    @Override
    public int insert(Organize organize) {
        return dao.insert("front.organize.insert",organize);
    }

    @Override
    public int delete(Organize organize) {
        return 0;
    }

    @Override
    public int update(Organize organize) {
        return dao.update("front.organize.update", organize);
    }

    @Override
    public Organize selectOne(Organize organize) {
        return (Organize) dao.selectOne("front.organize.selectOne", organize);
    }

    @Override
    public PagerModel selectPageList(Organize organize) {
        return dao.selectPageList("front.organize.selectPageList",
                "front.organize.selectPageCount", organize);
    }

    @Override
    public List<Organize> selectList(Organize organize) {
        return dao.selectList("front.organize.selectList", organize);
    }

    @Override
    public int deleteById(int id) {
        return 0;
    }

    @Override
    public Organize selectById(String id) {
        return null;
    }

    public Organize selectByPrincipalPhone(Organize organize){
        return (Organize)dao.selectOne("front.organize.selectByPrincipalPhone",organize);
    }

    @Override
    public List<Organize> selectSubList(Organize organize) {
        return dao.selectList("front.organize.selectSubList", organize);
    }
}